package com.thread.threadfirst.javaBase.java8;

/**
 * interface的default、static
 */
public class InterfaceDefaultStaticTest {


    private interface Vehicle {
        default void print() {
            System.out.println("我是一辆车!");
        }

        static void blowHorn() {
            System.out.println("按喇叭!!!");
        }
    }

    private interface FourWheeler {
        default void print() {
            System.out.println("我是一辆四轮车!");
        }
    }

    private static class Car implements Vehicle,FourWheeler{

        @Override
        public void print() {
            Vehicle.super.print();
            FourWheeler.super.print();
            Vehicle.blowHorn();
            System.out.println("我是巴拉巴拉");
        }
    }

    public static void main(String[] args) {
        Vehicle vehicle=new Car();
        vehicle.print();
    }
}
